package com.rslai.base.tool.servertest.objectfactory;

import com.rslai.base.tool.servertest.util.Util;

import java.lang.reflect.Type;
import java.math.BigDecimal;

public class BigDecimalFactory extends InstanceFactory {
    protected Object create(Type type, Object value) {
        if (Util.isEmpty(value).booleanValue()) return null;

        return new BigDecimal(value.toString());
    }

    protected boolean support(Type type) {
        return type.equals(BigDecimal.class);
    }
}
